#ifndef WIN32UTIL_H
#define WIN32UTIL_H
#include "windows.h"
#include "QString"
#include "psapi.h"
#include "tlhelp32.h"
#include "QDebug"
#include "tlbbcode.h"
#include "QPoint"
#include "QApplication"
#include "QClipboard"
#include "QMimeData"
#include "winuser.h"
#include "QTimer"
#include "timemanager.h"
#include "gamemanager.h"

class Win32Util : public QObject
{
Q_OBJECT
private:
     explicit Win32Util(QObject *parent = nullptr);

public:

    static QString getWindowTextW(HWND hwnd);
    //获取游戏窗口的矩形
    static QRect getGameRect();
    //设置鼠标位置
    static void moveMouse(int dual_x, int dual_y);

    //模拟左单键击，若需要双击则延时几毫秒再点击一次即可
    static void mouseLeftClick(bool isDoubleClick =false);
    //鼠标滚轮 正数向上滚动 负数向下滚动
    static void mouseWheel(int length);
    //模拟鼠标右击，若需要双击则延时几毫秒再点击一次即可
    static void mouseRightClick();

    //键盘
    static void keyboardClick(unsigned char keyCode);

    static void keyboardClick(QString message, bool isPaste = true);

    //组合键
    static void keyboardClick(unsigned char keyCode1, unsigned char keyCode2);

    //切换敌人
    static void switchEnemy();



    static QString getClipboard();

    static void pasteClipboard();

    static HWND findWind(QString className);

    static QList<DWORD>& findPidProcessName(QString processName);

    static qulonglong getBaseAddress(QString processName, QString moduleName);

    static DWORD getTargetAddress(HANDLE &hProcess, DWORD dwBase, int Numb, ...);

    static DWORD getMapNameAddress(HANDLE &hProcess, DWORD dwBase, DWORD address1, DWORD address2, DWORD address3, DWORD address4,DWORD address5);

    static void getTargetAddressContent(DWORD address, LPVOID& contetn);

    static bool setSetWindowPos();
signals:
};

#endif // WIN32UTIL_H
